package com.hzspace.gson.controller;

import com.hzspace.gson.bean.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Author: LiuHao
 * @Descirption:
 * @Date: 2020/2/27_18:07
 */
@RestController
public class JsonController {

    @GetMapping("json")
    public Object json(){
        List<User> list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            User user = new User();
            user.setId((long) i);
            user.setName("HZ");
            user.setAddress("www.hzspace.top");
            user.setBirthday(new Date());
            list.add(user);
        }
        return list;
    }
}
